
/*
    makes the command string that we need to send out
*/


// set up inlets/outlets
// outlet 0 = messages
// outlet 1 = subject area dimensions
// outlet 2 = images needed calculations
// outlet 3 = gcode to collection
outlets = 1;
inlets = 1;

// global varables and code
var mypath = "test";
var mynewpath = "test";
var myprefix = "test";
var mydirectory = "test";
var mycommand = "test";
//var mypathchar = "'/'";
//var mypathcharnew = "'\\'";
var mypathchar = "/";
var mypathcharnew = '\\\\';
var temp = "test";
var mydirectorynumber = "0";

function build_command(mypath, myprefix, mydirectory, mydirectorynumber)
{

  // change out the path with the double-slash
  var temp = mypath;
    var index = temp.indexOf(mypathchar);
        while(index != -1){
            temp = temp.replace(mypathchar,mypathcharnew);
            index = temp.indexOf(mypathchar);
        }
        //return temp;
   mynewpath = temp;

   mycommand = "dslrcontrols\\\\DSLRRemoteTest.exe -p "+myprefix+" -o "+mynewpath+mydirectory+"\\\\"+mydirectorynumber;
    outlet(0, mycommand)
    
}


            
